package io.elegant.sessions.widgets

import android.content.Context
import android.widget.ProgressBar
import io.elegant.Elegant
import io.elegant.ElegantApiGrpc
import io.elegant.widgets.ProgressBarWidget
import io.grpc.stub.StreamObserver
import kotlin.reflect.KClass

class WidgetProgressBarSession(
    stub: ElegantApiGrpc.ElegantApiStub,
    context: Context
): BaseWidgetSession<ProgressBar, ProgressBarWidget<ProgressBar>>(stub, context) {
    override val clazz = ProgressBar::class
    @Suppress("UNCHECKED_CAST")
    override val widgetClazz = ProgressBarWidget::class as KClass<ProgressBarWidget<ProgressBar>>
    override val sendStreamObserver: StreamObserver<Elegant.Interaction> = stub.widgetProgressBar(receiveStreamObserver)

}